package com.carleasoft.mps.cms.business.message.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.carleasoft.mps.cms.business.message.bean.entity.MessageNote;
import com.carleasoft.mps.cms.business.message.bean.entity.MessageReceive;
import com.carleasoft.mps.cms.business.message.bean.po.*;
import com.carleasoft.mps.cms.business.message.bean.vo.MessageNoteDetailVo;
import com.carleasoft.mps.cms.business.message.bean.vo.MessageNoteVo;
import com.carleasoft.mps.cms.business.message.service.MessageNoteService;
import com.carleasoft.mps.core.result.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 留言基础表 前端控制器
 * </p>
 *
 * @author fan
 * @since 2023-05-17
 */
@RestController
@RequestMapping("/messageNote")
public class MessageNoteController {

    @Autowired
    private MessageNoteService messageNoteService;

    /**
     * 留言-添加留言
     */
    @PostMapping("/massageNoteAdd")
    public R<Boolean> massageNoteAdd(@RequestBody MessageNoteAddPo messageNoteAddPo){
        return R.ok(messageNoteService.massageNoteAdd(messageNoteAddPo));
    }
    /**
     * 留言-删除
     */
    @PostMapping("/massageNoteDelete")
    public R<Boolean> massageNoteDelete(@RequestBody MessageNote messageNote){
        return R.ok(messageNoteService.massageNoteDelete(messageNote));
    }
    /**
     * 留言-分页查询
     */
    @PostMapping("/massageNotePageQuery")
    public R<Page<MessageNoteVo>> pageQuery(@RequestBody MessageNotePageQueryPo messageNotePageQueryPo){
        return R.ok(messageNoteService.pageQuery(messageNotePageQueryPo));
    }
    /**
     * 留言-详情
     */
    @PostMapping("/massageNoteDetail")
    public R<MessageNoteDetailVo> massageNoteDetail(@RequestBody MessageNote messageNote){
        return R.ok(messageNoteService.massageNoteDetail(messageNote));
    }
    /**
     * 留言-处理留言
     */
    @PostMapping("/massageNoteDeal")
    public R<Boolean> massageNoteDeal(@RequestBody NoteDealPo noteDealPo){
        return R.ok(messageNoteService.massageNoteDeal(noteDealPo));
    }
    /**
     * 留言-留言委派
     */
    @PostMapping("/massageNoteAppoint")
    public R<Boolean> massageNoteAppoint(@RequestBody MassageNoteAppointPo massageNoteAppointPo){
        return R.ok(messageNoteService.massageNoteAppoint(massageNoteAppointPo));
    }
    /**
     * 我的信箱-收到的回复
     */
    @PostMapping("/responseReceived")
    public R responseReceived(@RequestBody ResponseReceivedPagePo responseReceivedPagePo){
        return R.ok(messageNoteService.responseReceived(responseReceivedPagePo));
    }
    /**
     * 我的信箱-收到的回复的详情
     */
    @PostMapping("/responseReceivedDetail")
    public R responseReceivedDetail(@RequestBody MessageReceive messageReceive){
        return R.ok(messageNoteService.responseReceivedDetail(messageReceive));
    }
    /**
     * 工作台-留言待处理
     */
    @PostMapping("/massageNoteWait")
    public R<Page<MessageNote>> massageNoteWait(@RequestBody MassageNoteWaitPo massageNoteWaitPo){
        return R.ok(messageNoteService.massageNoteWait(massageNoteWaitPo));
    }
    /**
     * 统计分析-心理和法律援助
     */
    @PostMapping("/statisticalAnalysis/messageNote")
    public R statisticalAnalysisMessageNote(@RequestBody StatisticalAnalysisMessageNotePo statisticalAnalysisMessageNotePo){
        return R.ok(messageNoteService.statisticalAnalysisMessageNote(statisticalAnalysisMessageNotePo));
    }
}

